#pragma once

#include <cmath>
#include <cstring>

#include "Common.h"

#include "vec2f.h"
#include "vec3f.h"
#include "vec4f.h"

namespace davmath { class mat3f; }
using namespace davmath;

/* * * * * * * * * *
 * mat4f
 * Author:	David Ogle
 * Date:	26/03/2012
 * 3x3 array of float values
 * Column major order
 * * * * * * * * * */

class davmath::mat3f
{
public:

	// Data union
	union {
		float i[9];
		struct { float	aa, ab, ac,
						ba, bb, bc,
						ca, cb, cc; };
	};




	// Constructor
	mat3f(void) { toIdentity(); }
	mat3f(float elements[9]) { memcpy(this->i, elements, 9 * sizeof(float)); }
	// Destructor
	~mat3f(void) { };


	// Matrix functions
	void	toZero();
	void	toIdentity();


	// Matrix operators
	inline mat3f operator*(const mat3f &a) const;
	inline vec3f operator*(const vec3f &v) const;


};

